Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Actually close the connections properly #9

Merged
merged 1 commit into from
Dec 11, 2024

Conversation

matheus23
Copy link
Collaborator

Description

Properly closes the doctor connections.

  • active_side is the side that last receives data. Thus it needs to indicate it's happy via conn.close(...). For good measure, we also conn.closed().await.
  • passive_side is the side that last sends data and does accept_bi. We race this loop with the conn.closed() because that indicates the other side is done. As this is not an error, we just exit.
  • If the passive_side errors, we send a conn.close() earlier. This would be optional, if the Endpoint were shutdown gracefully... Which never happens. But that's another PR.

Change checklist

  • Self-review.
  • Documentation updates following the style guide, if relevant.
  • [ ] Tests if relevant.
  • All breaking changes documented.

@matheus23 matheus23 self-assigned this Dec 6, 2024
@matheus23 matheus23 merged commit 2fd49a3 into main Dec 11, 2024
14 checks passed
@matheus23 matheus23 deleted the matheus23/graceful-connection-close branch December 11, 2024 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant